package cn.iocoder.yudao.module.xiaoBizHandler.dal.mysql.tbErrorManagement;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.xiaoBizHandler.dal.dataobject.tbErrorManagement.XTbErrorManagementDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.xiaoBizHandler.controller.admin.tbErrorManagement.vo.*;
/**
 * 报错管理 Mapper
 *
 * @author xiaosy
 */
@Mapper
public interface XTbErrorManagementMapper extends BaseMapperX<XTbErrorManagementDO> {

    default PageResult<XTbErrorManagementDO> selectPage(XTbErrorManagementPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<XTbErrorManagementDO>()
			                .likeIfPresent(XTbErrorManagementDO::getName, reqVO.getName())
                .eqIfPresent(XTbErrorManagementDO::getRemarkContent, reqVO.getRemarkContent())
                .eqIfPresent(XTbErrorManagementDO::getCategory, reqVO.getCategory())
                .eqIfPresent(XTbErrorManagementDO::getLabel, reqVO.getLabel())
                .eqIfPresent(XTbErrorManagementDO::getReasonContent, reqVO.getReasonContent())
                .eqIfPresent(XTbErrorManagementDO::getSolutionContent, reqVO.getSolutionContent())

                .orderByDesc(XTbErrorManagementDO::getId));

    }

    default List<XTbErrorManagementDO> selectList(XTbErrorManagementExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<XTbErrorManagementDO>()
			                .likeIfPresent(XTbErrorManagementDO::getName, reqVO.getName())
                .eqIfPresent(XTbErrorManagementDO::getRemarkContent, reqVO.getRemarkContent())
                .eqIfPresent(XTbErrorManagementDO::getCategory, reqVO.getCategory())
                .eqIfPresent(XTbErrorManagementDO::getLabel, reqVO.getLabel())
                .eqIfPresent(XTbErrorManagementDO::getReasonContent, reqVO.getReasonContent())
                .eqIfPresent(XTbErrorManagementDO::getSolutionContent, reqVO.getSolutionContent())

                .orderByDesc(XTbErrorManagementDO::getId));

    }

}

